import request from '@/utils/request'

export function login(username, password) {
  return request({
    url: '/sso/passlogin',
    method: 'post',
    data: {
      username,
      password
    }
  })
}
export function smslogin(username, authCode) {

  return request({
    url: '/sso/smslogin',
    method: 'post',
    data: {
      "telephone":username,
      "authCode":authCode
    }
  })
}


export function myInfo() {
  return request({
    url: '/sso/myInfo',
    method: 'get',
  })
}

export function logout() {
  return request({
    url: '/admin/logout',
    method: 'post'
  })
}

export function register(data) {
  return request({
    url: '/sso/register',
    method: 'post',
    data:data
  })
}
export function getAuthCode(telephone) {
  return request({
    url: '/sso/getAuthCode',
    method:'get',
    params:{
      "telephone":telephone
    }
  })
}



